home *** CD-ROM | disk | FTP | other *** search
- class classes.misc.Audio
- {
- var which1;
- var targetVol;
- var fadeOutSecs;
- var fadeInSecs;
- var currentVol;
- var level1FadeOut = false;
- var level1FadeIn = false;
- var c = 0;
- var Name = "audio";
- function Audio()
- {
- }
- function playLevel5(pwhich, pvol)
- {
- var _loc2_ = pwhich;
- var _loc3_ = pvol * 3;
- _root.aC5.s5.stop();
- _root.aC5.s5.attachSound(_loc2_);
- _root.aC5.s5.setVolume(_loc3_);
- _root.aC5.s5.start();
- }
- function playLevel4(pwhich, pvol)
- {
- var _loc2_ = pwhich;
- var _loc3_ = pvol * 3;
- _root.aC5.s5.stop();
- _root.aC4.s4.stop();
- _root.aC4.s4.attachSound(_loc2_);
- _root.aC4.s4.setVolume(_loc3_);
- _root.aC4.s4.start();
- }
- function playLevel3(pwhich, pvol)
- {
- var _loc2_ = pwhich;
- var _loc3_ = pvol * 3;
- _root.aC4.s4.stop();
- _root.aC5.s5.stop();
- _root.aC3.s3.stop();
- _root.aC3.s3.attachSound(_loc2_);
- _root.aC3.s3.setVolume(_loc3_);
- _root.aC3.s3.start();
- }
- function playLevel2(pwhich, pvol)
- {
- var _loc2_ = pwhich;
- var _loc3_ = pvol * 3;
- _root.aC2.s2.stop();
- _root.aC2.s2.attachSound(_loc2_);
- _root.aC2.s2.setVolume(_loc3_);
- _root.aC2.s2.start();
- }
- function playLevel1(pwhich, pvol, pfadeOutSecs, pfadeInSecs)
- {
- this.which1 = pwhich;
- this.targetVol = pvol * 3;
- this.fadeOutSecs = pfadeOutSecs;
- this.fadeInSecs = pfadeInSecs;
- this.currentVol = _root.aC1.s1.getVolume();
- if(this.currentVol == 0)
- {
- this.currentVol = 1;
- }
- this.level1FadeOut = true;
- this.c = 0;
- }
- function main()
- {
- if(this.level1FadeOut)
- {
- this.c = this.c + 1;
- var _loc3_ = this.currentVol - this.c * (this.currentVol / (this.fadeOutSecs * 30));
- _root.aC1.s1.setVolume(_loc3_);
- if(_loc3_ < 0)
- {
- _root.aC1.s1.stop();
- _root.aC1.s1.attachSound(this.which1);
- _root.aC1.s1.setVolume(0);
- var _loc4_ = !(this.which1 == "gammaThemeInstr" || this.which1 == "gammaThemeAcoustic") ? 999 : 0;
- _root.aC1.s1.start(0,_loc4_);
- this.level1FadeOut = false;
- this.level1FadeIn = true;
- this.c = 0;
- }
- }
- if(this.level1FadeIn)
- {
- this.c = this.c + 1;
- _loc3_ = this.c * (this.targetVol / (this.fadeInSecs * 30));
- _root.aC1.s1.setVolume(_loc3_);
- if(_loc3_ >= this.targetVol)
- {
- _root.aC1.s1.setVolume(this.targetVol);
- this.level1FadeIn = false;
- }
- }
- }
- }
-